package hst;

public class Town {
	public static final int GRID_WIDTH = 6;
	public static final int GRID_HEIGHT = 6;
	
	private int values[][];
	
	private int score;
	
	public Town() {
		values = new int[GRID_WIDTH][GRID_HEIGHT];
		score = 0;
	}

	public int getValue(int x, int y) {
		return values[x][y];
	}
	
	public void setValue(int x, int y, int value) {
		values[x][y] = value;
		
		score += Math.pow(10, value);
	}
	
	public boolean canPlace(int x, int y, int value) {
		if(values[x][y] == 0 && value != 0) { // Placing object on empty
			return true;
		} else if(values[x][y] != 0 && value == 0) { // Placing empty on object (clearing)
			return true;
		} else {
			return false;
		}
	}
	
	public int getScore() {
		return score;
	}
}
